const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  devServer: {
    host: "0.0.0.0",
    port: 3000,
    open: true,
    proxy: {
      "/api": {
        target: "https://api.example.com",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },

  css: {
    loaderOptions: {
      postcss: {
        postcssOptions: {
          plugins: [
            // 只保留这个插件
            require("postcss-px-to-viewport")({
              unitToConvert: "px",
              viewportWidth: 375,
              unitPrecision: 5,
              propList: ["*"],
              viewportUnit: "vw",
              fontViewportUnit: "vw",
              selectorBlackList: [],
              minPixelValue: 1,
              mediaQuery: false,
              exclude: [/node_modules/],
            }),
          ],
        },
      },
    },
  },
});
// module.exports = {
//   devServer: {
//     host: "0.0.0.0",
//     port: 3000,
//     open: true,
//     proxy: {
//       "/api": {
//         target: "https://api.example.com",
//         changeOrigin: true,
//         rewrite: (path) => path.replace(/^\/api/, ""),
//       },
//     },
//   },

//   css: {
//     loaderOptions: {
//       postcss: {
//         plugins: [
//           require("postcss-px-to-viewport")({
//             unitToConvert: "px",
//             viewportWidth: 375,
//             unitPrecision: 5,
//             propList: ["*"],
//             viewportUnit: "vw",
//             fontViewportUnit: "vw",
//             selectorBlackList: [],
//             minPixelValue: 1,
//             mediaQuery: false,
//             exclude: [/node_modules/],
//           }),
//         ],
//       },
//     },
//   },
// };
